

pub fn to_print(bytes: &[u8]) -> String {
    let len = bytes.len();
    let mut text = format!("字节包: {len} 字节, " );
    if len < 15 {
        text.push_str(&format!("{bytes:?}"));
    } else {
        text.push_str(&format!("前10个字节: {:?}", &bytes[0..10]));
    }
    text
}
